<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="model.Customer, java.util.*"%>
<%@page import="model.Salesman, model.ActionConstants"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<?xml version="1.0" charset="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

<html>
  <head>
    <title>Seleccione el cliente</title>
  </head>
  <body>
    <h4>Usuario:&nbsp;${sessionScope.salesman.name}</h4>
    Seleccione el cliente<br/>
    <form name="form1" action="OrderServlet?action=showHome" method="post">
      <select name="customerInfo">
        <c:forEach var="customer" items="${customers}">
          <option value="${customer.id};${customer.name};${customer.priceIndex};${customer.diasRequerido}">${customer.id}-${customer.name}</option>
        </c:forEach>
      </select><br/>
      <input type="submit" value="Seleccionar Cliente" />
    </form>
    <br/>
    <form name="form2" action="OrderServlet" method="post">
      <table border="0">
        <tr>
          <% if (((Salesman)session.getAttribute("salesman")).checkAction(ActionConstants.VER_INVENTARIO)) { %>
          <td><input type="submit" value="Inventario" name="action" /></td>
          <% } %>
          <% if (((Salesman)session.getAttribute("salesman")).checkAction(ActionConstants.REAL_VS_PLAN)) { %>
          <td><input type="submit" value="Real.Vs.Plan" name="action" /></td>
          <% } %>
        </tr>
        <tr>
          <% if (((Salesman)session.getAttribute("salesman")).checkAction(ActionConstants.CHEQUEAR_STATUS)) { %>
          <td colspan="2"><input type="submit" value="Status_Pedidos" name="action" /></td>
          <% } %>
        </tr>
      </table>
       <input type="hidden" name="return" value="showCustomers">
    </form>
    <a href="LoginServlet?action=logoff">Cerrar Sesión</a>
  </body>
</html>
